package com.ibigcat.module.system.enums.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;


@Getter
@AllArgsConstructor
public enum SystemEnum {
    PC(1, "管理端"),
    SAAS(2, "SaaS端"),
    PDA(3, "PDA"),
    PROCESSING_APPLET(4, "加工小程序"), DRIVER_TECHNICIAN_APP(5, "司机技师APP");

    private final Integer code;

    private final String name;

    public static SystemEnum valueCode(Integer code) {
        return Arrays.stream(values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }

    public static SystemEnum valueName(String name) {
        return Arrays.stream(values()).filter(e -> e.getName().equals(name)).findFirst().orElse(null);
    }
}
